classdef dotsDrawableImage < dotsDrawable
    % @class dotsDrawableImage
    % Draw an image from a file
    % Currently uses a fairly slow draw method, but good for instructions.
    
    properties (SetObservable = true)
        % Filename
          fileName='';
        % File type
          fileType='bmp';
    end
    
    
    methods
        
        function self = dotsDrawableImage
            self = self@dotsDrawable;
        end
        
        function draw(self)
            if ~isempty(self.fileName)
                % Get image array from file
                imageArray=imread(self.fileName, self.fileType);
                % Draw image array
                    Screen('PutImage', ...
                    self.windowNumber, ...
                    imageArray, ...
                    self.windowRect); 
            end
        end
    end
end